
$(document).ready(function(){
	
	
    myForm.submit("form#loginForm",{
	    	errorElement:'span',
			errorClass:'help-inline',
	        rules: {
				username: 	{ required: true},
	        	password: 	{ required: true}
	        },
	        messages: {
	        	username: {required:"请您输入用户名"},
	        	password: { required: "请输入密码"}
	        }
		},function(msg){
			var data = JSON.parse(msg);
			if(data.errno==0){
				location.href="/";
			}else{
				myAlert(data.msg);
			}
		}
	);

    
    
});

